Fix crash on iOS 26 when printing ErrorCode initialized from NSError #16000
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

WOOMOB-660
Description
This PR fixes a crash occurring on iOS 26 when converting certain
NSErrorvalues intoErrorCodeusingErrorCode(_nsError:).Problem
On iOS 26, some
NSErrorinstances, especially those from the Stripe SDK, cause a fatal crash when converted toErrorCodeand accessed or logged (e.g.,print(errorCode.code)).This crash does not occur on iOS 18.5, including on simulators.
Example that triggers the crash:
Notably, not all error codes cause this behavior. Some values are fine, while others fail, regardless of whether the code is valid or known to the Stripe SDK.
The issue can be seen using lldb
Solution
For now, avoid calling
errorCode.code, and callingerrorCode.errorCodeinstead.We will get in logs:
💳 Stripe Error Code: 2020instead of
💳 Stripe Error Code: SCPError(rawValue: 2020)Stripe Report: stripe/stripe-terminal-ios#362
Steps to reproduce
I only tested on iPadOS 26 (simulator and device), and wasn't able to check iPhone TTP crashes. To reproduce a crash on iPadOS:
Testing information
Additionally, it was tested on an iOS 26 device and there's no more crash. There's only an expected "unsupported software version" since TTP shouldn't work on the beta releases (https://docs.stripe.com/terminal/payments/setup-reader/tap-to-pay?platform=ios#supported-devices)
Screenshots
RELEASE-NOTES.txtif necessary.